
import { reactive } from "vue"
import VueCookies from 'vue-cookies'

const store = {
    state: reactive({
        token: VueCookies.get("Access-Token"),
        userInfo: null,
        userAuth: "",
        authRouterInfo: {},
        SYSTEM: 'cck-op'
    }),
    getToken() {
        return VueCookies.get("Access-Token")
    },
    setToken(newVal) {
        VueCookies.set("Access-Token", newVal)
    },
    setUserInfo(newVal) {
        this.state.userInfo = newVal
    },
    setUserAuth(newVal) {
        this.state.userAuth = newVal
    },
    setAuthRouterInfo(newVal) {
        this.state.authRouterInfo = newVal
    },
    SET_SYSTEM(newVal) {
        this.state.SYSTEM = newVal
    }
}

export default store